package com.my12306.train.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my12306.common.model.vo.PageVo;
import com.my12306.train.model.entity.MileageEntity;
import com.my12306.train.model.entity.TicketEntity;
import com.my12306.train.model.entity.TrainScheduleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 售票表
 *
 * @author ËÕÄÁÏ¦
 * @email
 * @date 2020-07-24 20:58:07
 */
@Mapper
public interface TicketDao extends BaseMapper<TicketEntity> {
    /**
     * 分页查询
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    List<TicketEntity> queryTicketPage(@Param("pageVo") PageVo pageVo, @Param("logicDelete") int logicDelete);

    /**
     * 分页查询总数
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    Integer queryTicketCount(PageVo pageVo, Integer logicDelete);

    /**
     * 根据ids批量删除
     *
     * @param ticketIds
     * @param logicDelete
     */
    void deleteTicketBatchByIds(@Param("list") List<Long> ticketIds, @Param("logicDelete") Integer logicDelete);

    List<TrainScheduleEntity> queryTrainByStationAndTrainType(@Param("trainTypes") List<String> trainTypes, @Param("fromId") long fromId, @Param("toId") long toId, @Param("logicDelete") int logicDelete);

    /**
     * 根据车次代码找出该车次的线路的时刻表
     * @param trainCode
     * @param logicDelete
     * @return
     */
    List<MileageEntity> queryRouteStationByTrainCode(@Param("trainCode") String trainCode, @Param("logicDelete") Integer logicDelete);
}
